<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/static/css/bootstrap.css">
</head>
<body>
<h1>笑话大全</h1>
<button class="btn  btn-danger one">获取笑话中。。。</button>
      <div id="content">

      </div>
</body>
<script src="/static/js/jquery-3.1.1.min.js"></script>
<script>
    $(function () {
        $('.one').click(function () {
            $.get(
                'save',
                function (data) {
                 console.log(data.result.data);
                    if (data.error_code==0){
                        var str='';
                        $.each(data.result.data,function (i,v) {
                            str+="<p>第"+(i+1)+"条<br/>"+v.content+"<br/>更新时间:"+v.updatetime+"<br/>"+v.unixtime+"<br/>"+v.hashId+"</p>"
                        });
                        $('#content').html(str);
                    }else {
                        alert(data.error_code+":"+data.reason);
                    }

                }
            )
        })
    })
</script>
</html>